package com.project.base.controller;

import com.project.base.service.CodeService;

import com.project.core.auth.CodeDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@Api("字典项信息")
@RestController
@RequestMapping("code")
public class CodeController {
    @Resource
    private CodeService codeService;
    @ApiOperation("创建字典项")
    @PostMapping("save")
    public void save(@RequestBody @Valid CodeDTO codeDTO){
        this.codeService.save(codeDTO);
    }

    @PostMapping("delete")
    public void delete(@RequestBody @Valid CodeDTO codeDTO){ this.codeService.delete(codeDTO); }
}
